home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ODProcessUtils.cpp
-
- Contains: xxx put contents here xxx
-
- Owned by: Reggie Adkins
-
- Copyright: © 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <1> 9/17/96 RA first checked in
-
- To Do:
- */
-
- #ifndef _ODPROCESSUTILS_
- #include "ODProcessUtils.h"
- #endif
-
- //-------------------------------------------------------------------------------------
- // FindFinder
- //-------------------------------------------------------------------------------------
-
- // Will find the precise process of signature 'sig' and type 'type'
-
- OSErr
- FindProcess(ProcessSerialNumberPtr aPSN, OSType sig, unsigned long type)
- {
- ProcessInfoRec theProcessInfo;
- FSSpec theProcessFile;
- Str31 theProcessName;
- OSErr theError = noErr;
-
- aPSN->lowLongOfPSN = 0;
- aPSN->highLongOfPSN = kNoProcess;
- theProcessInfo.processInfoLength = sizeof(ProcessInfoRec);
- theProcessInfo.processName = theProcessName;
- theProcessInfo.processAppSpec = &theProcessFile;
- do {
- theError = GetNextProcess(aPSN);
- if (theError == noErr) {
- GetProcessInformation(aPSN, &theProcessInfo);
- }
- } while(((theProcessInfo.processSignature != sig) ||
- (theProcessInfo.processType != type)) &&
- (theError == noErr));
- return(theError);
- }
-